package leetcode.offer;

public class T10 {
    class Solution {
        public int fib(int n) {
            if (n <= 0) {
                return 0;
            }
            int a = 0;
            int b = 1;
            int c = 1;
            while (n-- > 1) {
                c = (a + b) % 1000000007;
                a = b;
                b = c;
            }
            return c;
        }
    }
}
